<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/sub.css" />
		<link rel="stylesheet" type="text/css" href="css/discover.css" />
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
	</head>

	<body>
		<!-- 侧滑导航根容器 -->
		<!-- 头部 -->
		<header class="mui-bar mui-bar-nav detail">
	       <a class="mui-pull-left icon-left" href="index.html"></a>
	       <h1 class="detail-tit mui-ellipsis mui-pull-left">商城列表</h1>
	       <a href="" class="mui-pull-right icon-serve" style="font-size: .64rem;"></a>
	   </header>
			<!--主题内容-->
		<div class="mui-content">
			<!--S二级导航-->
			<div class="sub-nav">
				<a class="cus-col-2 active" data-index="0" href="javascript:;">
					喜糖
				</a>
				<a class="cus-col-2" data-index="1" href="javascript:;">
					喜帖
				</a>
				<a class="cus-col-2" data-index="2" href="javascript:;">
					服饰
				</a>
				<a class="cus-col-2" data-index="3" href="javascript:;">
					首饰
				</a>
				<a class="cus-col-2" data-index="4" href="javascript:;">
					其他
				</a>
			</div>
			<!--E二级导航-->
			<!--S筛选框-->
			<div id="selectWrap">
				
			</div>
			<!--E筛选框-->

			<div id="content-wrap">

			</div>

		</div>
		<!--脚部-->
		<nav class="mui-bar mui-bar-tab condition">
			 <button class="sort-btn">排序</button>
			 <button class="screen-btn active">筛选</button>
		</nav>
		<!--S筛选框-->
		<script type="text/html" id="selectJs">
				<div class="select close">
	   				<div class="select-wrap">
	   					{{each result as item index}}
			   				<div class="select-item mui-clearfix">
								<div class="select-header mod-title-24" data-type="{{item.type}}">
									{{item.name}}
								</div>
								<div class="select-content">
									<ul>
										{{each item.con as coniemt}}
										<li  data-wy="{{coniemt.wy}}">{{coniemt.name}}</li>
										{{/each}}
									</ul>
								</div>
							</div>
						{{/each}}
	   				</div>
	   			</div>
	   			<div class="rank close" data-type="{{paixu.type}}">
					 <ul>
					 	{{each paixu.con as item index}}
					 		<li data-wy="{{item.id}}">{{item.name}}</li>
					 	{{/each}}
					 </ul>
				</div>
				<div class="select-btn close">
					<button class="clear-btn">清除</button>
					<button class="confirm-btn">确认</button>
				</div>
				<!--覆盖层-->
				<div class="p-cover close">
				</div>
		</script>
		<!--S筛选框-->
		
		<!--S详情列表-->
		<script type="text/html" id="moddeJs">
			<div class="item-list modde">
				{{each planlist as item index}}
				<div class="hotel-item mui-clearfix">
					<div class="hotel-item-header mui-pull-left">
						<img src="{{item.pic}}?imageView2/1/w/261/h/261" />
					</div>
					<div class="hotel-item-body mui-pull-left">
						<h2 class="mod-title-30 mui-ellipsis">{{item.title}}</h2>
						<p class="mod-price mui-ellipsis">&yen;{{item.sales_volume}}</p>
						<p class="mod-info-24 mt6 mui-ellipsis-2 chal-detail">{{item.abstract}}</p>
						<p class="mod-info-20">收藏：{{item.sales_volume}} 销量：{{item.collection_mun}}</p>
						<a href="javascript:;" class="mod-nav">查看详情 ></a>
						<!--<a href="detail_shop.html?wy={{item.wy}}" class="mod-nav">查看详情 ></a>-->
					</div>
				</div>
				{{/each}}
			</div>
		</script>
		<!--E详情列表-->
		<script src="js/artTemplate.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mod.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/event/list_event.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//喜糖  喜帖  服饰  首饰  其他
			var urlList=["http://www.xhwed.com/xhwe.php/SugarShop/planList","http://www.xhwed.com/xhwe.php/CardShop/planList","http://www.xhwed.com/xhwe.php/ClothesShop/planList","http://www.xhwed.com/xhwe.php/JewelryShop/planList","http://www.xhwed.com/xhwe.php/OtherShop/planList"]
			var urlFilter= ["http://www.xhwed.com/xhwe.php/SugarShop/filter","http://www.xhwed.com/xhwe.php/CardShop/filter","http://www.xhwed.com/xhwe.php/ClothesShop/filter","http://www.xhwed.com/xhwe.php/JewelryShop/filter","http://www.xhwed.com/xhwe.php/OtherShop/filter"]
			/*筛选筛选框*/
			drawFilter(urlFilter[0]);
			/*请求内容*/
			trueAjax();
				function trueAjax() {
					/*请求内容*/
					var num=parseInt(mui(".sub-nav>a.active")[0].getAttribute("data-index"));
					/*筛选筛选框*/
					drawFilter(urlFilter[num]);
					/*请求关闭覆盖层*/
					toggleBtn(".p-cover,.select,.rank,.select-btn",false);
					mui.ajax(urlList[num],{
						data:getData(),
						dataType:'json',//服务器返回json格式数据
						type:'post',//HTTP请求类型
						timeout:10000,//超时时间设置为10秒；
						success:function(data){
							console.log(data);
							var html =data.result.planlist!=null?template("moddeJs",data.result):'<div class="null-img"><img src="img/static/null.jpg"/></div>';
							mui("#content-wrap")[0].innerHTML = html;
							//console.log(getData());
						},
						error:function(xhr,type,errorThrown){
							//异常处理；
							console.log(type);
						}
					})
				}
				
				mui(".sub-nav")[0].addEventListener("tap",function(ev){
					var ev=ev||window.event;
					var target=ev.target||ev.srcElement;
					if(target.nodeName.toLowerCase()=="a")
					{
						var parent=target.parentNode.querySelector(".active");
						parent.className=parent.className.replace(/\s*active/g,"");
						target.className=target.className+" active";
						trueAjax();
					}
				})
		</script>

	</body>

</html>